package com.chee.plant.hibernate.object.base;

import java.io.Serializable;

/**
 * This is an object that contains data related to the user_friend table. Do not
 * modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 * 
 * @hibernate.class table="user_friend"
 */

public abstract class BaseUserFriend implements Serializable {

	public static String REF = "UserFriend";
	public static String PROP_CREATED = "Created";
	public static String PROP_OWNER_ID = "OwnerId";
	public static String PROP_FRIEND_ID = "FriendId";
	public static String PROP_ID = "Id";

	// constructors
	public BaseUserFriend() {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BaseUserFriend(java.lang.Integer id) {
		this.setId(id);
		initialize();
	}

	/**
	 * Constructor for required fields
	 */
	public BaseUserFriend(java.lang.Integer id, java.lang.Integer ownerId,
			java.lang.Integer friendId, java.util.Date created) {

		this.setId(id);
		this.setOwnerId(ownerId);
		this.setFriendId(friendId);
		this.setCreated(created);
		initialize();
	}

	protected void initialize() {
	}

	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private java.lang.Integer id;

	// fields
	private java.lang.Integer ownerId;
	private java.lang.Integer friendId;
	private java.util.Date created;

	/**
	 * Return the unique identifier of this class
	 * 
	 * @hibernate.id generator-class="sequence" column="id"
	 */
	public java.lang.Integer getId() {
		return id;
	}

	/**
	 * Set the unique identifier of this class
	 * 
	 * @param id
	 *            the new ID
	 */
	public void setId(java.lang.Integer id) {
		this.id = id;
		this.hashCode = Integer.MIN_VALUE;
	}

	/**
	 * Return the value associated with the column: owner_id
	 */
	public java.lang.Integer getOwnerId() {
		return ownerId;
	}

	/**
	 * Set the value related to the column: owner_id
	 * 
	 * @param ownerId
	 *            the owner_id value
	 */
	public void setOwnerId(java.lang.Integer ownerId) {
		this.ownerId = ownerId;
	}

	/**
	 * Return the value associated with the column: friend_id
	 */
	public java.lang.Integer getFriendId() {
		return friendId;
	}

	/**
	 * Set the value related to the column: friend_id
	 * 
	 * @param friendId
	 *            the friend_id value
	 */
	public void setFriendId(java.lang.Integer friendId) {
		this.friendId = friendId;
	}

	/**
	 * Return the value associated with the column: created
	 */
	public java.util.Date getCreated() {
		return created;
	}

	/**
	 * Set the value related to the column: created
	 * 
	 * @param created
	 *            the created value
	 */
	public void setCreated(java.util.Date created) {
		this.created = created;
	}

	public boolean equals(Object obj) {
		if (null == obj)
			return false;
		if (!(obj instanceof com.chee.plant.hibernate.object.UserFriend))
			return false;
		else {
			com.chee.plant.hibernate.object.UserFriend userFriend = (com.chee.plant.hibernate.object.UserFriend) obj;
			if (null == this.getId() || null == userFriend.getId())
				return false;
			else
				return (this.getId().equals(userFriend.getId()));
		}
	}

	public int hashCode() {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getId())
				return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":"
						+ this.getId().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}

	public String toString() {
		return super.toString();
	}

	private static final long serialVersionUID = 1L;
}